<template>
  <div class="home">
    <el-container>
      <el-aside>
        <el-col :span="24">
          <el-menu
            default-active="1"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            @select="sureindex"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
            style="height: 100vh;"
            
            

          >
          <h2 class="el-h2">后台管理系统</h2>
            <el-menu-item index="1">
              <i class="el-icon-s-home"></i>
              <span slot="title">首页</span>
            </el-menu-item>
            <el-menu-item index="2">
              <i class="el-icon-s-goods"></i>
              <span slot="title">商品详情</span>
            </el-menu-item>
            
            <el-menu-item index="3">
              <i class="el-icon-user"></i>
              <span slot="title">客户详情</span>
            </el-menu-item>
            <el-submenu index="4">
              <template slot="title">
                <i class="el-icon-document"></i>
                其他
              </template>
              <el-menu-item index="4-1">
              <i class="el-icon-s-tools"></i>
              权限设置
              </el-menu-item>
            </el-submenu>

            <!-- <el-menu-item index="4">
              <i class="el-icon-setting"></i>
              <span slot="title">其他</span>
            </el-menu-item> -->
          </el-menu>
        </el-col>
      </el-aside>
      <el-container style="height:100vh">
        <el-header style="background: red">Header</el-header>
        <router-view></router-view>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  created() {
    // this.$router.push({
    //     path: '/1',
    //   })
    //   .catch(err=>{})
  },
  data() {
    return {
     
    }
  },
  methods: {
    handleOpen(key, keyPath) {
      // console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      // console.log(key, keyPath);
    },
    sureindex(index, indexPath) {
      console.log(index, indexPath);
      this.$router.push({
        path: `/` + index,
      })
      .catch(err=>{})
    },
  },
};
</script>

<style scoped>
.qweqwe {
  width: 100%;
}
.el-submenu .el-menu-item {
  min-width: 0;
  overflow: hidden;
}
.el-h2{
text-align: center;
color: #fff;
padding-top: 10px;
}


</style>